<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="./layui/css/layui.css">
		<script src="./layui/layui.js" charset="utf-8"></script>
		<!-- 配置文件 -->
		<script type="text/javascript" src="./editor/ueditor.config.js"></script>
		<!-- 编辑器源码文件 -->
		<script type="text/javascript" src="./editor/ueditor.all.js"></script>
	</head>
	<body>
		<form method="post" class="layui-form layui-form-pane" action="release.html" style="margin-left: 30px;">
			<fieldset class="layui-elem-field layui-field-title">
				<legend>发布</legend>

				<div class="layui-form-item">
					<label class="layui-form-label">标题</label>
					<div class="layui-input-block" style="width: 400px;">
						<input name="title" class="layui-input" type="text" placeholder="请输入标题" autocomplete="off" lay-verify="required">
					</div>
				</div>

				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">分类</label>
						<div class="layui-input-inline" style="z-index: 9999;">
							<select name="modules" lay-search="" lay-verify="required">
								<option value="">搜索或选择</option>
								<option value="1">1</option>
							</select>
						</div>
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">预估机况</label>
					<div class="layui-input-block">
						<input name="sex" title="几乎全新" type="radio" checked="" value="几乎全新">
						<input name="sex" title="功能完好,轻微划痕/磕碰" type="radio" value="功能完好,轻微划痕/磕碰">
						<input name="sex" title="小异常或小维修" type="radio" checked="" value="小异常或小维修">
						<input name="sex" title="进水或核心部件维修" type="radio" checked="" value="进水或核心部件维修">
						
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label" style="float: none;">描述</label>
					<div class="layui-inline" style="z-index: 9;margin-top: 20px ;width: 800px;">
						<!-- 加载编辑器的容器 -->
						<script id="container" name="content" type="text/plain">
						</script>
						<!-- 实例化编辑器 -->
					</div>
				</div>


				<div class="layui-upload">
					<button class="layui-btn" id="test2" type="button">图片上传(可多张)</button>
					<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;max-width: 770px;">
						预览图：
						<div class="layui-upload-list" id="demo2"></div>
					</blockquote>
				</div>



				<div class="layui-form-item">
					<label class="layui-form-label">价格</label>
					<div class="layui-input-block">
						<input name="price" class="layui-input" type="text" placeholder="￥" autocomplete="off" lay-verify="price" style="width: 225px;">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">联系人</label>
					<div class="layui-input-block">
						<input name="user" class="layui-input" type="text" placeholder="请输入联系人" autocomplete="off" lay-verify="required" style="width: 225px;">
					</div>
				</div>
				

				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">联系电话</label>
						<div class="layui-input-inline" style="width: 400px;">
							<input name="phone" class="layui-input" type="tel" autocomplete="off" lay-verify="required|phone" placeholder="请输入手机号码">
						</div>
					</div>
				</div>


				<div class="layui-form-item">
					<button class="layui-btn" lay-filter="demo2" lay-submit="">提交</button>
				</div>


			</fieldset>
		</form>
	</body>

	<script>
		//select的渲染
		layui.use('form', function() {
			var form = layui.form;
			form.verify({
				price: function(value) {
					if (!/^[0-9]+.?[0-9]*$/.test(value))
						return '格式有误，请填入非负整数';
				}
			})
		})

		//upload的启用
		layui.use('upload', function() {
			var $ = layui.jquery,
				upload = layui.upload;

			//多图片上传
			upload.render({
				elem: '#test2',
				url: 'https://httpbin.org/post' //改成您自己的上传接口
					,
				multiple: true,
				before: function(obj) {
					//预读本地文件示例，不支持ie8
					obj.preview(function(index, file, result) {
						$('#demo2').append('<img src="' + result + '" alt="' + file.name + '" class="layui-upload-img">')
					});
				},
				done: function(res) {
					//上传完毕
				}
			});
		})
	</script>


	<script type="text/javascript">
		var ue = UE.getEditor('container');
	</script>
</html>
